-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake: Optional Install if Embedded #1330
Conversation
When adding this library as embedded library with private "target link", e.g. only used inside private source files, the library does not need to be installed when the main project gets installed. This adds an additional option `JSON_Install` similar to the test-build control switch in order to skip installing headers and CMake config files if requested. Avoids using ```cmake add_subdirectory(path/to/nlohmann_json EXCLUDE_FROM_ALL) ``` which has further side-effects: https://cmake.org/cmake/help/v3.0/command/add_subdirectory.html
Yes, I would also know what @chuckatkins thinks about this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any thoughts, @chuckatkins ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi @chuckatkins, sorry to bother you about this but I wonder if this is good practice or if you also just go with |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
ping @chuckatkins any idea? |
@t-b I am still wondering what other projects do, since this seems to be a common workflow that a simple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks a lot! |
@nlohmann Thanks for merging. @ax3l According to https://stackoverflow.com/a/51746390 most projects add an option to skip the installation. |
Good to know, so my intuition wasn't all off. Thanks for merging! |
When adding this library as embedded library with private "target link", e.g. only used inside private source files, the library does not need to be installed when the main project gets installed.
This adds an additional option
JSON_Install
similar to the test-build control switch in order to skip installing headers and CMake config files if requested.Avoids using
which has further side-effects:
https://cmake.org/cmake/help/v3.0/command/add_subdirectory.html
cc @chuckatkins do you have an opinion on this?